class ContactMailer < ActionMailer::Base
  helper ApplicationHelper

  def  contact_to_admin(contact)
    setup_email(contact)
    @recipients = App[:recipients]
    @from =  App[:from]
    @subject = "[VPN-FAST] #{contact.name} 様からお問い合わせを受け付けました"
    @sent_on     = Time.now
  end
  def  contact_to_user(contact)
    setup_email(contact)
    @recipients = contact.email
    @from =  App[:from]
    @subject = "[VPN-FASTからのお知らせ] お問い合わせありがとうございました"
    @sent_on     = Time.now
  end


  protected
  def setup_email(contact)
    @from        = App[:from]
    @sent_on     = Time.now
    @body[:contact] = contact
  end

end
